import request from '@/utils/request'

export function fetchList(query) {
  return request({
    url: '/vue-element-admin/article/list',
    method: 'get',
    params: query
  })
}

export function fetchArticle(id) {
  return request({
    url: '/vue-element-admin/article/detail',
    method: 'get',
    params: { id }
  })
}

export function fetchPv(pv) {
  return request({
    url: '/vue-element-admin/article/pv',
    method: 'get',
    params: { pv }
  })
}

export function getNames(names) {
  return request({
    url: `/vue-element-admin/article/names`,
    method: 'get',
    params: { names }
  })
}

export function createArticle(data) {
  return request({
    url: '/vue-element-admin/article/create',
    method: 'post',
    data
  })
}

export function updateArticle(data) {
  return request({
    url: '/vue-element-admin/article/update',
    method: 'post',
    data
  })
}

export function getLogin(data) {
  return request({
    url: '/vue-element-admin/article/login',
    method: 'post',
    data
  })
}

export function getInformation(data) {
  return request({
    url: '/vue-element-admin/article/information',
    method: 'get',
    params: { data }
  })
}

export function getReview(data) {
  return request({
    url: '/vue-element-admin/article/checklist',
    method: 'get',
    params: { data }
  })
}

export function getPanelGroup(data) {
  return request({
    url: '/vue-element-admin/article/getmainicon',
    method: 'get',
    params: { data }
  })
}

export function getRecentNum(data) {
  return request({
    url: '/vue-element-admin/article/getrecentnum',
    method: 'get',
    params: { data }
  })
}
